<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Spring Boot Banner 自定义指南</title>
    <link rel="stylesheet" href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css">
    <link rel="stylesheet" href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            color: #333;
            line-height: 1.6;
        }
        h1, h2, h3, h4 {
            font-family: 'Noto Serif SC', serif;
            font-weight: 600;
        }
        .hero-gradient {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }
        .code-block {
            background-color: #2d3748;
            color: #e2e8f0;
            border-radius: 0.5rem;
            font-family: 'Courier New', monospace;
        }
        .card-hover {
            transition: all 0.3s ease;
        }
        .card-hover:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        }
        .dropcap::first-letter {
            float: left;
            font-size: 4rem;
            line-height: 0.65;
            margin: 0.1em 0.2em 0.1em 0;
            color: #667eea;
            font-family: 'Noto Serif SC', serif;
        }
    </style>
</head>
<body class="bg-gray-50">
    <!-- Hero Section -->
    <section class="hero-gradient text-white py-20 px-4 md:px-0">
        <div class="container mx-auto max-w-5xl text-center">
            <div class="flex justify-center mb-6">
                <span class="bg-white bg-opacity-20 px-4 py-2 rounded-full text-sm font-medium flex items-center">
                    <i class="fas fa-code mr-2"></i>Spring Boot 开发指南
                </span>
            </div>
            <h1 class="text-4xl md:text-5xl font-bold mb-6">自定义Spring Boot启动Banner</h1>
            <p class="text-xl md:text-2xl max-w-3xl mx-auto opacity-90">为您的应用程序打造独特的启动标识，从第一行代码开始彰显个性</p>
            <div class="mt-12 bg-white bg-opacity-10 rounded-lg p-6 inline-block">
                <pre class="text-sm md:text-base text-left"><code> _______  _______  __   __  _______    _______ 
|       ||       ||  |_|  ||       |  |       |
|    ___||   _   ||       ||    ___|  |_     _|
|   | __ |  | |  ||       ||   |___     |   |  
|   ||  ||  |_|  ||       ||    ___|    |   |  
|   |_| ||       | |     | |   |___     |   |  
|_______||_______|  |___|  |_______|   |___|</code></pre>
            </div>
        </div>
    </section>

    <!-- Main Content -->
    <div class="container mx-auto max-w-5xl px-4 md:px-0 py-12">
        <!-- Introduction Section -->
        <section class="mb-16">
            <div class="flex items-center mb-8">
                <div class="h-px bg-gray-300 flex-1"></div>
                <h2 class="text-2xl md:text-3xl font-semibold px-4 text-gray-700">开始定制您的专属Banner</h2>
                <div class="h-px bg-gray-300 flex-1"></div>
            </div>
            
            <div class="dropcap mb-6 text-gray-700 text-lg leading-relaxed">
                Spring Boot 允许您在应用程序启动时展示一个独特的 Banner（启动 Logo）。虽然 Spring Boot 提供了默认的 Banner，但您完全可以自定义它以匹配您的项目风格或品牌形象。这个看似简单的功能实际上能为开发体验增添不少乐趣，也能让您的应用在启动时给人留下专业且独特的印象。
            </div>
            
            <div class="grid md:grid-cols-3 gap-8 mt-8">
                <div class="bg-white rounded-xl shadow-md p-6 card-hover">
                    <div class="text-blue-500 mb-4 text-2xl">
                        <i class="fas fa-file-alt"></i>
                    </div>
                    <h3 class="text-xl font-semibold mb-3">简单易用</h3>
                    <p class="text-gray-600">只需简单的文本文件，无需复杂配置即可实现自定义Banner</p>
                </div>
                <div class="bg-white rounded-xl shadow-md p-6 card-hover">
                    <div class="text-purple-500 mb-4 text-2xl">
                        <i class="fas fa-paint-brush"></i>
                    </div>
                    <h3 class="text-xl font-semibold mb-3">创意无限</h3>
                    <p class="text-gray-600">支持ASCII艺术和文本组合，充分发挥您的创造力</p>
                </div>
                <div class="bg-white rounded-xl shadow-md p-6 card-hover">
                    <div class="text-green-500 mb-4 text-2xl">
                        <i class="fas fa-cogs"></i>
                    </div>
                    <h3 class="text-xl font-semibold mb-3">技术细节</h3>
                    <p class="text-gray-600">深入了解SpringApplicationBannerPrinter的工作原理</p>
                </div>
            </div>
        </section>

        <!-- Steps Section -->
        <section class="mb-16">
            <h2 class="text-2xl md:text-3xl font-semibold mb-8 text-gray-700 border-b pb-4">实现步骤</h2>
            
            <div class="space-y-8">
                <div class="flex flex-col md:flex-row gap-6">
                    <div class="md:w-1/4 flex-shrink-0">
                        <div class="bg-blue-100 text-blue-800 rounded-full w-12 h-12 flex items-center justify-center font-bold text-xl mx-auto md:mx-0">1</div>
                    </div>
                    <div class="md:w-3/4">
                        <h3 class="text-xl font-semibold mb-3 text-gray-800">创建banner.txt文件</h3>
                        <p class="text-gray-600">在您的项目中创建一个新的文本文件，命名为<code class="bg-gray-100 px-2 py-1 rounded">banner.txt</code>。</p>
                    </div>
                </div>
                
                <div class="flex flex-col md:flex-row gap-6">
                    <div class="md:w-1/4 flex-shrink-0">
                        <div class="bg-blue-100 text-blue-800 rounded-full w-12 h-12 flex items-center justify-center font-bold text-xl mx-auto md:mx-0">2</div>
                    </div>
                    <div class="md:w-3/4">
                        <h3 class="text-xl font-semibold mb-3 text-gray-800">设计您的Banner内容</h3>
                        <p class="text-gray-600 mb-4">在文件中输入您想要显示的自定义Logo文字或ASCII艺术图案。您可以使用普通文本或ASCII字符创建独特的Logo。</p>
                        <div class="code-block p-4 rounded-lg mt-2 overflow-x-auto">
                            <pre><code> _______  _______  __   __  _______    _______ 
|       ||       ||  |_|  ||       |  |       |
|    ___||   _   ||       ||    ___|  |_     _|
|   | __ |  | |  ||       ||   |___     |   |  
|   ||  ||  |_|  ||       ||    ___|    |   |  
|   |_| ||       | |     | |   |___     |   |  
|_______||_______|  |___|  |_______|   |___|</code></pre>
                        </div>
                    </div>
                </div>
                
                <div class="flex flex-col md:flex-row gap-6">
                    <div class="md:w-1/4 flex-shrink-0">
                        <div class="bg-blue-100 text-blue-800 rounded-full w-12 h-12 flex items-center justify-center font-bold text-xl mx-auto md:mx-0">3</div>
                    </div>
                    <div class="md:w-3/4">
                        <h3 class="text-xl font-semibold mb-3 text-gray-800">放置文件到资源目录</h3>
                        <p class="text-gray-600">将<code class="bg-gray-100 px-2 py-1 rounded">banner.txt</code>文件放置在项目的<code class="bg-gray-100 px-2 py-1 rounded">src/main/resources</code>目录下。</p>
                        <div class="mt-4">
                            <img src="https://cdn.nlark.com/yuque/0/2023/png/21449790/1676425093522-4468e2d1-fffb-4f7f-ab14-b22d69b4eab4.png" alt="SpringApplicationBannerPrinter" class="rounded-lg shadow-md w-full max-w-lg border border-gray-200">
                            <p class="text-sm text-gray-500 mt-2">SpringApplicationBannerPrinter 类处理Banner输出</p>
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <!-- Visualization Section -->
        <section class="mb-16">
            <h2 class="text-2xl md:text-3xl font-semibold mb-8 text-gray-700 border-b pb-4">Banner定制流程</h2>
            <div class="bg-white p-6 rounded-xl shadow-md">
                <div class="mermaid">
                    graph TD
                    A[开始] --> B[创建banner.txt文件]
                    B --> C[设计ASCII艺术或文本内容]
                    C --> D[放置到resources目录]
                    D --> E[启动Spring Boot应用]
                    E --> F[显示自定义Banner]
                </div>
            </div>
        </section>

        <!-- Tips Section -->
        <section class="mb-16">
            <h2 class="text-2xl md:text-3xl font-semibold mb-8 text-gray-700 border-b pb-4">高级技巧</h2>
            <div class="grid md:grid-cols-2 gap-8">
                <div class="bg-white p-6 rounded-xl shadow-md card-hover">
                    <h3 class="text-xl font-semibold mb-4 text-gray-800 flex items-center">
                        <i class="fas fa-magic text-purple-500 mr-3"></i> 动态变量
                    </h3>
                    <p class="text-gray-600">您可以在Banner中使用以下变量，Spring Boot会在运行时替换为实际值：</p>
                    <ul class="list-disc pl-5 mt-3 space-y-2 text-gray-600">
                        <li><code>${application.version}</code> - 应用版本</li>
                        <li><code>${spring-boot.version}</code> - Spring Boot版本</li>
                        <li><code>${application.title}</code> - 应用名称</li>
                    </ul>
                </div>
                <div class="bg-white p-6 rounded-xl shadow-md card-hover">
                    <h3 class="text-xl font-semibold mb-4 text-gray-800 flex items-center">
                        <i class="fas fa-palette text-green-500 mr-3"></i> 颜色与样式
                    </h3>
                    <p class="text-gray-600">在支持ANSI颜色的终端中，您可以使用以下语法为Banner添加颜色：</p>
                    <div class="code-block p-4 rounded-lg mt-3">
                        <pre><code>${AnsiColor.BRIGHT_RED}
  _____ _   _ ____  _____ ____  
 |_   _| | | |  _ \| ____/ ___| 
   | | | |_| | |_) |  _|| |  _  
   | | |  _  |  __/| |__| |_| | 
   |_| |_| |_|_|   |_____\____| 
${AnsiColor.DEFAULT}</code></pre>
                    </div>
                </div>
            </div>
        </section>
    </div>

    <!-- Footer -->
    <footer class="bg-gray-900 text-white py-8">
        <div class="container mx-auto max-w-5xl px-4 text-center">
            <div class="flex flex-col items-center">
                <p class="text-gray-400 mb-2">技术小馆</p>
                <a href="http://www.yuque.com/jtostring" class="text-blue-400 hover:text-blue-300 transition-colors duration-200">
                    <i class="fas fa-external-link-alt mr-1"></i> www.yuque.com/jtostring
                </a>
            </div>
        </div>
    </footer>

    <script>
        mermaid.initialize({
            startOnLoad: true,
            theme: 'default',
            flowchart: {
                useMaxWidth: true,
                htmlLabels: true,
                curve: 'basis'
            }
        });
    </script>
</body>
</html>